<?php
namespace Tools\Controller;
use Common\Controller\AdminbaseController;

/**
 * 楼盘预约.
 * User: 郝飞
 * Date: 2017/3/6
 * Time: 16:25
 */
class AdminMakeController extends AdminbaseController{


	public function _initialize() {
		parent::_initialize();
	}

	/*预约列表*/
	public function index() {
		$Model = D();
		$list =$Model
			->field('a.houses_name,b.*')
			->table('__HOUSES__ a,__MAKE__ b')
			->where('a.houses_id = b.houses_id')
			->order("make_addtime desc")
			->select();
		$this->assign('lists',$list);
		$this->display();
	}

	/*预约列表搜索*/
	public function search() {
		$keyword = I("make_name");
		echo $keyword;
		$Model = D();
		$where['user_name|user_identity|user_mobile|houses_name'] = array('like',"%$keyword%");
		$list = $Model
			->field('a.houses_name,b.*')
			->table('__HOUSES__ a,__MAKE__ b')
			->where('a.houses_id = b.houses_id')
			->where($where)
			->order("make_addtime desc")
			->select();
		$this->assign('lists',$list);
		$this->display('index');
	}

}